from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")

    app_name: str = "FastAPI测试项目"
    admin_email: str = "1787585212@qq.com"
    debug: bool = True
    port: int = 8000
    items_per_user: int = 50
    database_url: str = "sqlite:///./test.db"
    connect_args: dict = {}


# 实例化Settings对象
# 单例，全局复用
settings = Settings()
